package com.github.blanexie.nexusj.infrastructure.repository

import com.github.blanexie.nexusj.domain.peer.PeerAggregate
import com.github.blanexie.nexusj.domain.peer.PeerId
import com.github.blanexie.nexusj.infrastructure.repository.impl.PeerDO

interface PeerRepository {

    fun save(peerAggregate: PeerAggregate)

    fun findByPeerId(peerId: PeerId): PeerAggregate?

    /**
     * 获取活动的peer, 根据最后上报时间排序,
     */
    fun findByInfoHash(infoHash:String):List<PeerDO>

}